<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>C MIP-SDK: mip_sdk_interface.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">C MIP-SDK
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">mip_sdk_interface.h File Reference</div>  </div>
</div>
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="mip_8h_source.html">mip.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="mip__sdk__config_8h_source.html">mip_sdk_config.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="mip__sdk__user__functions_8h_source.html">mip_sdk_user_functions.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="ring__buffer_8h_source.html">ring_buffer.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="byteswap__utilities_8h_source.html">byteswap_utilities.h</a>&quot;</code><br/>
</div>
<p><a href="mip__sdk__interface_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__mip__interface.html">_mip_interface</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae31c21a66dab1de362101689c0da544f"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_INPUT_RING_BUFFER_SIZE" ref="ae31c21a66dab1de362101689c0da544f" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_INPUT_RING_BUFFER_SIZE</b>&#160;&#160;&#160;MIP_MAX_PACKET_SIZE</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a04af46ce91753f678b811649224de808"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_CALLBACK_VALID_PACKET" ref="a04af46ce91753f678b811649224de808" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_CALLBACK_VALID_PACKET</b>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3257dc416269e7abc3e09b5c0c005570"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_CALLBACK_CHECKSUM_ERROR" ref="a3257dc416269e7abc3e09b5c0c005570" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_CALLBACK_CHECKSUM_ERROR</b>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afdb57865e49ff99e4bcff27ff20b8b76"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_CALLBACK_TIMEOUT" ref="afdb57865e49ff99e4bcff27ff20b8b76" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_CALLBACK_TIMEOUT</b>&#160;&#160;&#160;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45590e6242aa1e79442c6b6c453c6cfb"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_OK" ref="a45590e6242aa1e79442c6b6c453c6cfb" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_OK</b>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f79f733581ce07703675b58d32a3c84"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_ERROR" ref="a6f79f733581ce07703675b58d32a3c84" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_ERROR</b>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe23bc7b71e9bc9d20afcf50b9583cdc"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_TIMEOUT" ref="abe23bc7b71e9bc9d20afcf50b9583cdc" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_TIMEOUT</b>&#160;&#160;&#160;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a88825618bb37153068231cd43ab36f1d"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_NO_TIMEOUT" ref="a88825618bb37153068231cd43ab36f1d" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_NO_TIMEOUT</b>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5644d35e9367b899b112d85fdaf441b5"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_INITIALIZED" ref="a5644d35e9367b899b112d85fdaf441b5" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_INITIALIZED</b>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac748161a31e4d56358f4384184a0f805"></a><!-- doxytag: member="mip_sdk_interface.h::MIP_INTERFACE_UNINITIALIZED" ref="ac748161a31e4d56358f4384184a0f805" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MIP_INTERFACE_UNINITIALIZED</b>&#160;&#160;&#160;0</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e3ceb17df81f3d069fc9f63b3f780dc"></a><!-- doxytag: member="mip_sdk_interface.h::parser_callback_ptr" ref="a7e3ceb17df81f3d069fc9f63b3f780dc" args=")(void *, u8 *, u16, u8)" -->
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>parser_callback_ptr</b> )(void *, u8 *, u16, u8)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba1220a24d0284a64ad9ef18608eccc4"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface" ref="aba1220a24d0284a64ad9ef18608eccc4" args="" -->
typedef struct <a class="el" href="struct__mip__interface.html">_mip_interface</a>&#160;</td><td class="memItemRight" valign="bottom"><b>mip_interface</b></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a8348893a39d9c02d535bc0c2a92617e0">mip_interface_init</a> (u32 com_port, u32 baudrate, <a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u32 packet_timeout_val)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a865238514ffa638e58aacc29bde2242a">mip_interface_close</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#aa7e3e36fb2524f2b47b374fbc5c98acf">mip_interface_add_descriptor_set_callback</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 data_set, void *user_ptr, void(*packet_callback)(void *user_ptr, u8 *packet, u16 packet_size, u8 callback_type))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#aae7f32dd10e2150ccc46e80542e5953d">mip_interface_delete_descriptor_set_callback</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 data_set)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a5c80b43dbac9dfcbc2d5a6458d5fe21c">mip_interface_update</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a47d437db123ec316511aad8cfdf4f0e9">mip_interface_send_command</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 command_set, u8 command_descriptor, u8 *command_data, u16 command_data_size, u8 wait_for_response, u32 timeout_ms)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a86b01de54ff1b8085b099e916d757038">mip_interface_send_preformatted_command</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 *command, u16 command_size, u8 wait_for_response, u32 timeout_ms)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a886f509e0555dcc9f101a4828b118af6">mip_interface_send_command_with_response</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 command_set, u8 command_descriptor, u8 *command_data, u16 command_data_size, u8 **response_data, u16 *response_data_size, u32 timeout_ms)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a317f6595f35da8090f34c39f19b58a2d">mip_interface_send_preformatted_command_with_response</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 *command, u16 command_size, u8 **response_data, u16 *response_data_size, u32 timeout_ms)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#aaa02ad5b56c5a90dd0fb2b6a6e62a408">mip_interface_write</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 *data, u32 num_bytes, u32 *bytes_written)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a2f56f7f1ef4d3d620d5415bb880c26d2">mip_interface_write_blocking</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 *data, u32 num_bytes, u32 *bytes_written, u32 timeout_ms)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a0f31c0a8a19cf411d3b0cbfeac64fd25">__mip_interface_parse_input_buffer</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#ab2649a0821d41047afe3fbcaee69f0b9">__mip_interface_find_callback</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 data_set, void **callback_user_ptr, parser_callback_ptr *callback_function)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a91c210b9527322da462f0ad57a96880f">__mip_interface_time_timeout</a> (u32 initial_time, u32 timeout_ms)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a3e6100be0b513b61c7a0495e4a079a87">__mip_interface_wait_for_response</a> (<a class="el" href="struct__mip__interface.html">mip_interface</a> *device_interface, u8 command_set, u8 command_descriptor, u8 *acknack_response, u8 **response_data, u16 *response_data_size, u32 timeout_ms)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip__sdk__interface_8h.html#a761cb54740a05b849a2ab10b162ec629">__mip_interface_command_response_handler</a> (void *user_ptr, u8 *packet, u16 packet_size, u8 callback_type)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Nathan Miller </dd></dl>
<dl class="version"><dt><b>Version:</b></dt><dd>1.1 </dd></dl>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a761cb54740a05b849a2ab10b162ec629"></a><!-- doxytag: member="mip_sdk_interface.h::__mip_interface_command_response_handler" ref="a761cb54740a05b849a2ab10b162ec629" args="(void *user_ptr, u8 *packet, u16 packet_size, u8 callback_type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void __mip_interface_command_response_handler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>user_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>packet_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>callback_type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Command-Response Handler. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">void</td><td>*user_ptr - Pointer to the user data for this callback. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*packet - The MIP packet that matches the waiting command set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>packet_size - Size of the MIP packet. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>callback_type - Type of callback. </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This is an internal function. </p>

</div>
</div>
<a class="anchor" id="ab2649a0821d41047afe3fbcaee69f0b9"></a><!-- doxytag: member="mip_sdk_interface.h::__mip_interface_find_callback" ref="ab2649a0821d41047afe3fbcaee69f0b9" args="(mip_interface *device_interface, u8 data_set, void **callback_user_ptr, parser_callback_ptr *callback_function)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 __mip_interface_find_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>data_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void **&#160;</td>
          <td class="paramname"><em>callback_user_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">parser_callback_ptr *&#160;</td>
          <td class="paramname"><em>callback_function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Find the callback info for the provided dataset. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - pointer to the mip interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>data_set - dataset to search for. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">void</td><td>*callback_user_ptr - pointer to the user data for the callback. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">parser_callback_ptr</td><td>callback_function - pointer to callback function. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>The callback could not be located or there was an error.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>The callback was located.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This is an internal function. </p>

</div>
</div>
<a class="anchor" id="a0f31c0a8a19cf411d3b0cbfeac64fd25"></a><!-- doxytag: member="mip_sdk_interface.h::__mip_interface_parse_input_buffer" ref="a0f31c0a8a19cf411d3b0cbfeac64fd25" args="(mip_interface *device_interface)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 __mip_interface_parse_input_buffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Processes the bytes in the input buffer and triggers the callback function. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - pointer to the mip interface structure. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>Interface not initialized.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>Parser ran.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This is an internal function. </p>

</div>
</div>
<a class="anchor" id="a91c210b9527322da462f0ad57a96880f"></a><!-- doxytag: member="mip_sdk_interface.h::__mip_interface_time_timeout" ref="a91c210b9527322da462f0ad57a96880f" args="(u32 initial_time, u32 timeout_ms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 __mip_interface_time_timeout </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>initial_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Check for a timeout condition. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>initial_time - the start time to check against in milliseconds. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>timeout_ms - the timeout period in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_TIMEOUT</td><td>The timeout has occured.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_NO_TIMEOUT</td><td>No timeout.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This is an internal function. </p>

</div>
</div>
<a class="anchor" id="a3e6100be0b513b61c7a0495e4a079a87"></a><!-- doxytag: member="mip_sdk_interface.h::__mip_interface_wait_for_response" ref="a3e6100be0b513b61c7a0495e4a079a87" args="(mip_interface *device_interface, u8 command_set, u8 command_descriptor, u8 *acknack_response, u8 **response_data, u16 *response_data_size, u32 timeout_ms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 __mip_interface_wait_for_response </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>command_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>command_descriptor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>acknack_response</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 **&#160;</td>
          <td class="paramname"><em>response_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16 *&#160;</td>
          <td class="paramname"><em>response_data_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Wait for a Command-Response. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - a pointer to the mip_interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>command_set - the command set we are waiting for. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>command_descriptor - the command descriptor we are waiting for. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u8</td><td>*acknack_response - the resulting ack/nack response from the device. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u8</td><td>**response_data - a pointer to a pointer to the response data, NULL if no data field exists. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u16</td><td>*response_data_size - size of the response data, 0 if no data field exists. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>timeout_ms - the timeout in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>If a response was received.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>If the response was not received in the timeout period.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This is an internal function. </p>

</div>
</div>
<a class="anchor" id="aa7e3e36fb2524f2b47b374fbc5c98acf"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_add_descriptor_set_callback" ref="aa7e3e36fb2524f2b47b374fbc5c98acf" args="(mip_interface *device_interface, u8 data_set, void *user_ptr, void(*packet_callback)(void *user_ptr, u8 *packet, u16 packet_size, u8 callback_type))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_add_descriptor_set_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>data_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>user_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(void *user_ptr, u8 *packet, u16 packet_size, u8 callback_type)&#160;</td>
          <td class="paramname"><em>packet_callback</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Add a callback for the provided descriptor set. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - pointer to the mip interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>data_set - data set used to trigger the callback. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">void</td><td>*user_ptr - pointer to the user data, which is passed to the callback. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">void</td><td>(*packet_callback) - function pointer for packet callback function. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>The callback could not be added.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>The callback was added successfully.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None. </p>

</div>
</div>
<a class="anchor" id="a865238514ffa638e58aacc29bde2242a"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_close" ref="a865238514ffa638e58aacc29bde2242a" args="(mip_interface *device_interface)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_close </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>MIP Interface Close function. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - The device interface. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>The interface was not closed.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>The interface was successfully closed.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="aae7f32dd10e2150ccc46e80542e5953d"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_delete_descriptor_set_callback" ref="aae7f32dd10e2150ccc46e80542e5953d" args="(mip_interface *device_interface, u8 data_set)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_delete_descriptor_set_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>data_set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Delete the callback for the provided descriptor set if it exists. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - pointer to the mip interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>data_set - data set to remove callbacks. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>The callback could not be removed.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>The callback was removed successfully.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None. </p>

</div>
</div>
<a class="anchor" id="a8348893a39d9c02d535bc0c2a92617e0"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_init" ref="a8348893a39d9c02d535bc0c2a92617e0" args="(u32 com_port, u32 baudrate, mip_interface *device_interface, u32 packet_timeout_val)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_init </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>com_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>baudrate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>packet_timeout_val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>MIP Interface Initialization function. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>com_port - The port to interface to. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>baudrate - The baudrate of the port. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - The device interface. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>packet_timeout_val - Timeout for the incoming packet in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>The interface was not initialized.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>The interface was successfully initialized.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a47d437db123ec316511aad8cfdf4f0e9"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_send_command" ref="a47d437db123ec316511aad8cfdf4f0e9" args="(mip_interface *device_interface, u8 command_set, u8 command_descriptor, u8 *command_data, u16 command_data_size, u8 wait_for_response, u32 timeout_ms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_send_command </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>command_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>command_descriptor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>command_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>command_data_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>wait_for_response</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Send a MIP command and optionally wait for the response data. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - a pointer to the mip_interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>command_set - command set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>command_descriptor - command descriptor. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*command_data - preformatted command data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>command_data_size - size of command data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>wait_for_response - 1: The function will wait for the response, 0: it will not wait. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>timeout_ms - the timeout in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>If a response was received and ACK'd or no resonse requested.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>If the response was not received in the timeout period or NACK'd.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None. </p>

</div>
</div>
<a class="anchor" id="a886f509e0555dcc9f101a4828b118af6"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_send_command_with_response" ref="a886f509e0555dcc9f101a4828b118af6" args="(mip_interface *device_interface, u8 command_set, u8 command_descriptor, u8 *command_data, u16 command_data_size, u8 **response_data, u16 *response_data_size, u32 timeout_ms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_send_command_with_response </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>command_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>command_descriptor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>command_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>command_data_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 **&#160;</td>
          <td class="paramname"><em>response_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16 *&#160;</td>
          <td class="paramname"><em>response_data_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Send a MIP command and wait for the response data. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - a pointer to the mip_interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>command_set - command set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>command_descriptor - command descriptor. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*command_data - preformatted command data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>command_data_size - size of command data. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u8</td><td>**response_data - pointer to a pointer that will point to the beginning of the response. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u16</td><td>*response_data_size - size of the response data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>timeout_ms - the timeout in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>If a response was received and ACK'd.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>If the response was not received in the timeout period or NACK'd.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p><code>response_data</code> will point to an internal buffer within the MIP interface.<br/>
 The user should copy the information to their own buffer before manipulation. </p>

</div>
</div>
<a class="anchor" id="a86b01de54ff1b8085b099e916d757038"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_send_preformatted_command" ref="a86b01de54ff1b8085b099e916d757038" args="(mip_interface *device_interface, u8 *command, u16 command_size, u8 wait_for_response, u32 timeout_ms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_send_preformatted_command </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>command</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>command_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>wait_for_response</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Send a pre-formatted command and wait for the response data. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - a pointer to the mip_interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*command - preformatted MIP command. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>command_size - size of MIP command. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>wait_for_response - 1: The function will wait for the response, 0: it will not wait. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>timeout_ms - the timeout in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>If a response was received and ACK'd or no resonse requested.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>If the response was not received in the timeout period or NACK'd.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None. </p>

</div>
</div>
<a class="anchor" id="a317f6595f35da8090f34c39f19b58a2d"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_send_preformatted_command_with_response" ref="a317f6595f35da8090f34c39f19b58a2d" args="(mip_interface *device_interface, u8 *command, u16 command_size, u8 **response_data, u16 *response_data_size, u32 timeout_ms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_send_preformatted_command_with_response </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>command</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>command_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 **&#160;</td>
          <td class="paramname"><em>response_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16 *&#160;</td>
          <td class="paramname"><em>response_data_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Send a pre-formatted command and wait for the response data. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - a pointer to the mip_interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*command - preformatted MIP command. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>command_size - size of MIP command. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u8</td><td>**response_data - pointer to a pointer that will point to the beginning of the response. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u16</td><td>*response_data_size - size of the response data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>timeout_ms - the timeout in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>If a response was received and ACK'd.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>If the response was not received in the timeout period or NACK'd.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p><code>response_data</code> will point to an internal buffer within the MIP interface.<br/>
 The user should copy the information to their own buffer before manipulation. </p>

</div>
</div>
<a class="anchor" id="a5c80b43dbac9dfcbc2d5a6458d5fe21c"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_update" ref="a5c80b43dbac9dfcbc2d5a6458d5fe21c" args="(mip_interface *device_interface)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_update </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>MIP Interface Update function. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - The device interface. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>The interface was not initialized.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>The update step completed.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This function should be called regularly (e.g. every step of a minor cycle.)<br/>
 This is the main loop of the interface. </p>

</div>
</div>
<a class="anchor" id="aaa02ad5b56c5a90dd0fb2b6a6e62a408"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_write" ref="aaa02ad5b56c5a90dd0fb2b6a6e62a408" args="(mip_interface *device_interface, u8 *data, u32 num_bytes, u32 *bytes_written)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>num_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>bytes_written</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Writes <code>num_bytes</code> of <code>data</code> to the device interface. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - pointer to the mip interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*data - pointer to data buffer to be written. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>num_bytes - the number of bytes to be written. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>Data not written or less than num_bytes written.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>Data written.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This function is used to write bytes from a device to the interface,<br/>
 which will then be parsed. </p>

</div>
</div>
<a class="anchor" id="a2f56f7f1ef4d3d620d5415bb880c26d2"></a><!-- doxytag: member="mip_sdk_interface.h::mip_interface_write_blocking" ref="a2f56f7f1ef4d3d620d5415bb880c26d2" args="(mip_interface *device_interface, u8 *data, u32 num_bytes, u32 *bytes_written, u32 timeout_ms)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_interface_write_blocking </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__mip__interface.html">mip_interface</a> *&#160;</td>
          <td class="paramname"><em>device_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>num_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>bytes_written</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>timeout_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Writes <code>num_bytes</code> of <code>data</code> to the device interface, blocks until the space is available. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mip_interface</td><td>*device_interface - pointer to the mip interface structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*data - pointer to data buffer to be written. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>num_bytes - the number of bytes to be written. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u32</td><td>timeout_ms - the timeout for the write in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_INTERFACE_ERROR</td><td>Data not written or less than num_bytes written.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INTERFACE_OK</td><td>Data written.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>This function is used to write bytes from a source into the interface,<br/>
 which will then be parsed. </p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri May 30 2014 17:03:33 for C MIP-SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
